<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBrandsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('brands', function (Blueprint $table) {
            $table->increments('id');
            $table->string('goods_name')->nullable()->comment('商品名称');;
            $table->string('coupon_url')->nullable()->comment('优惠券链接');;
            $table->decimal('sell_price', 8, 2)->default(0)->comment('商品价格');
            $table->decimal('discount_price', 8, 2)->default(0)->comment('优惠金额');
            $table->decimal('actual_price', 8, 2)->default(0)->comment('到手价');
            $table->decimal('com_price', 8, 2)->default(0)->comment('佣金');
            $table->time('shelf_time')->default(0)->comment('上架时间');
            $table->time('active_time')->default(0)->comment('活动时间');
            $table->unsignedInteger('own_sale')->default(0)->comment('懒人销量');
            $table->unsignedInteger('tao_sale')->default(0)->comment('淘宝销量');
            $table->integer('sort')->default(0)->comment('排序');
            $table->integer('weigh')->default(0)->comment('权重');
            $table->unsignedTinyInteger('shelf_status')->default(0)->comment('1上架，0下架');
            $table->string('pic_url', 200)->nullable()->comment('图片地址');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('brands');
    }
}
